/*
 * @Descripttion:调用后端订单接口的函数
 * @Author: congz
 * @Date: 2020-06-14 14:24:12
 * @LastEditors: congz
 * @LastEditTime: 2020-08-12 20:03:36
 */

import axios from 'axios'
import request from "@/api/utils/request";

// 创建订单
export function createOrder(form) {
  let target = '/createOrder/'
  return request.post(target,form)
}

export function listOrders(id,type,start,limit) {
  let target = '/showOrder?'
   target += 'user_id=' + id + '&type=' + type +'&start='+ start +'&limit='+limit
  return request.get(target)
}

export function showOrder(id) {
  let target = '/showOrderDetail?'
   target += 'order_id=' + id
  return request.get(target)
}

export function deleteOrder(id,order_id) {
  let target = '/deleteOrder?'
   target += 'user_id=' + id + '&order_id=' + order_id
  return request.get(target)
}
export function exitOrder(id,order_id) {
  let target = '/exitOrder?'
   target += 'user_id=' + id + '&order_id=' + order_id
  return request.get(target)
}
export function completeOrder(id,order_id) {
  let target = '/CompleteOrder?'
   target += 'user_id=' + id + '&order_id=' + order_id
  return request.get(target)
}